

public class MuncitorPlataCuOra extends Muncitor {

  private double ore = -1.0;
  private double PlataPeOra = -1.0;
  private double oreSupProc = -1.0;
  private static final double orePeSaptObl = 39.0;

  public MuncitorPlataCuOra(String nume) {
    super(nume);
  }

   public MuncitorPlataCuOra(String nume, double ore, double PlataPeOra,
			 double oreSupProc) {
    super(nume);
    this.ore= ore;
    this.PlataPeOra= PlataPeOra;
    this.oreSupProc = oreSupProc;
  }

  public void setInfoSalar(double n, double PlataPeOra,
			      double oreSupProc) {
    this.ore= n;
    this.PlataPeOra = PlataPeOra;
    this.oreSupProc = oreSupProc;
  }
    
  public double getore() {  
    return ore;
  }

  public double getPlataPeOra() {
    return PlataPeOra;
  }

  public double getoreSupProc() {
    return oreSupProc;
  }

  public double getSalar() {
    if (ore != -1 && PlataPeOra != -1 && oreSupProc!= -1) {
      if (ore> orePeSaptObl) {
	return PlataPeOra* (orePeSaptObl +
			       (ore - orePeSaptObl) 
			       * (1 + oreSupProc / 100));
      }
      else {
	return PlataPeOra * ore;
      }
    }
    else {
      return -1;
    }
  }

  public String toString() {
    return super.toString() + ";ore=" + ore 
      + "; tarif orar=" + PlataPeOra + "; % Ore Suplimentare=" + oreSupProc;
  }

}

